<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Contact_model extends CI_Model {

    function __construct() {
        parent::__construct();
    }

    function sendMessage($data){
        $res = false;
        if (is_array($data) && !empty($data)){
            $this->db->set('mail_message', $data['message'])
                     ->set('mail_from', $data['from'])
                     ->set('mail_to', $data['to']);
            if ($this->db->insert('mailbox')){
                $res = true;
            }
        }
        return $res;
    }
}